1. Field of the Invention
The present invention relates to the field of data processing.
2. Description of the Prior Art
In data processing systems, a data value may sometimes contain a number of adjacent bits whose values are of interest independently from the rest of the data value. Such a group of adjacent bits can be referred to as a bitfield, and the number of adjacent bits in the group can be referred to as its width. For example, a data value representing an RGB colour value may include bitfields representing the red, green and blue components respectively. Sometimes it may be desirable to manipulate the data value containing the bitfield so as to isolate the bitfield from its surroundings. For example, one may desire to extract or replace only the green component of the RGB colour value. The present technique seeks to provide an efficient encoding of a bitfield manipulation instruction that can control a processing apparatus to perform a wide variety of different kinds of bitfield manipulations.
In the present application the notation <X:Y> indicates a group of adjacent bits extending from a most significant bit at bit position X to a least significant bit at bit position Y. The width of a group described by <X:Y> is X−Y+1 bits. For example, the expression <4:0> indicates the group of width 5 bits at bit positions 4 to 0, where bit <4> is more significant than bit <0>. Note that the notation <X:Y> does not imply any particular storage order of the bits within a storage location, since the storage order need not be the same as the order of significance (e.g. big-endian or little-endian storage formats may be used).
In the present application the prefix 0b followed by a sequence of 1s and 0s represents a numeric value in binary notation. For example 0b110 represents the value 6 in decimal notation,